package com.leecode;

public class Leet136 {
	public static void main(String[] args) {
		new Leet136().singleNumber(new int[]{2, 2, 1});
	}

	/**
	 * 99%,79%
	 */
	public int singleNumber(int[] nums) {
		if(nums==null || nums.length<1)return 0;
		int res=nums[0];
		if(nums.length==1)return res;

		for(int a=1;a<nums.length;a++){
			res^=nums[a];
		}
		return res;
	}
}
